//
//  CommentDefine.h
//  HaiGeErTwo
//
//  Created by liuchen on 2018/9/9.
//  Copyright © 2018年 海格尔. All rights reserved.
//

#ifndef CommentDefine_h
#define CommentDefine_h

#pragma mark ==========系统状态栏+导航栏高度==========
#define SYSTEM_STATUSBAR_HEGHT [[UIApplication sharedApplication] statusBarFrame].size.height
#define SYSTEM_NAV_HEGHT self.navigationController.navigationBar.frame.size.height
#define SYSTEM_TOP SYSTEM_STATUSBAR_HEGHT+SYSTEM_NAV_HEGHT

#pragma mark ==========系统尺寸单位==========
#define SCALEUNIT [[UIScreen mainScreen] bounds].size.width/750.0
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height

#pragma mark ==========三色值+各模块对应色值==========
#define RGBA(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
#define LOGINTITLERGBA RGBA(178,178,178,1)
#define LOGINBACKRGBA  [UIColor colorWithHexString:@"#eeeeee"]
#define LOGINBUTTONBACKRGBA RGBA(0,185,165,1)
#define HEXCOLOR(hex) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8)) / 255.0 blue:((float)(hex & 0xFF)) / 255.0 alpha:1]

#pragma mark ==========弱引用==========
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#pragma mark ==========字体==========
#define kGlobalFontFamilyName @"Snell Roundhand"
#define LoginFont 15

#pragma mark ==========手机号+密码正则==========
#define LOGINPHONECHECK(phoneNum) [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", @"^1(3[0-9]|4[57]|5[0-35-9]|8[0-9]|7[0678])\\d{8}$"] evaluateWithObject:phoneNum]
#define LOGINPASSWORDCHECK(password) [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", @"^(?=.*[a-zA-Z0-9].*)(?=.*[a-zA-Z\\W].*)(?=.*[0-9\\W].*).{6,20}$"] evaluateWithObject:password]

#pragma mark ==========判空==========
#define isEmpty(thing) thing == nil|| [thing isKindOfClass:[NSNull class]]|| ([thing respondsToSelector:@selector(length)]&& [(NSData *)thing length] == 0)|| ([thing respondsToSelector:@selector(count)]&& [(NSArray *)thing count] == 0)

#pragma mark ==========base64加密==========
#define BASE64(password) [[NSString alloc] initWithData:[[password dataUsingEncoding:NSUTF8StringEncoding] base64EncodedDataWithOptions:0] encoding:NSUTF8StringEncoding]

#pragma mark ==========界面缩放比==========
#define SCALING SCREEN_WIDTH/375.0f

#pragma mark ==========AppKey==========
#define UPUSH @"5bbebd98f1f556f3530000b6"
#define BUGLY @"40b65904f3"
#define BAIDU @"SArYDQOaZy1kp48Rp71D2Nx2M97TGFxC"


#endif /* CommentDefine_h */
